<template>
	<div>
		<span class="category" @click="getCategory" >{{Category}}</span>
		{{categoryList}}
	</div>
</template>

<script>
export default {
	props:['Category','CategoryId'],
	data: function () {
		return {
			categoryList: ''
		}
	},
	methods:{
		getCategory(){
			let mes = document.getElementsByClassName('category'),
				len = mes.length
			for (let i = 0; i < len; i++) {
				mes[i].onclick = function (){
						this.categoryList =  mes[i].innerHTML
						console.log(	this.categoryList)
				}
				
			}
			this.$emit('childByValue', this.categoryList)
			
		}
	}
}
</script>

<style>

</style>
